<?php
namespace Home\Controller;

use Org\Util\Date;
use Think\Controller\RestController;

class IndexController extends RestController
{

    public function index()
    {
        $d1=strtotime(new Date());
        $d2=strtotime('2016-7-30 16:00:00');
        $date=new Date();
        echo $date->dateDiff('2016-7-30 16:00:00','h');
        var_dump(($d1-$d2)/3600);
    }

    public function index_post($aa)
    {
        $test = M('test');
        $id = $test->add(array(
            'name' => $aa
        ));
        echo $id;
    }

    public function index_put()
    {
        echo 'put';
    }

    public function index_delete()
    {
        echo 'delete';
    }

    public function test($aaa)
    {
//        dump(I('a'));
        echo $_GET['aaa'];
        echo $aaa;
//        var_dump(I('get'));
    }
}